package com.biz.primus.ms.oms.stream;

import com.biz.primus.model.oms.stream.OrderStateChannel;
import org.springframework.cloud.stream.annotation.Output;
import org.springframework.messaging.MessageChannel;

/**
 * @author yanweijin
 * @date 2017/11/6
 */
public interface OrderStateSource extends OrderStateChannel{


	String PUSHER = "oms-order-outbound-pusher";

	@Output(ORDER_BEGIN+PUSHER)
	MessageChannel orderBeginOutput();
	
	@Output(ORDER_OUTBOUND+PUSHER)
	MessageChannel orderOutboundOutput();

	@Output(ORDER_FINISHED+PUSHER)
	MessageChannel orderFinishedOutput();

//	@Output(REFUND)
//	MessageChannel refund();
//
//	/**
//	 * 根据订单状态获取对应渠道
//	 * @param state
//	 * @return
//	 */
//	default MessageChannel getChannelByOrderState(OrderState state){
//		switch (state) {
//			case begin:         return orderBeginOutput();
////			case allocated:
////			case printed:
//			case outbound:      return orderOutboundOutput();
//			case finished:      return orderFinishedOutput();
//			default:
//				throw new IllegalArgumentException("暂时不支持这些通道:"+state);
//		}
//	}



}
